# -*-coding: Utf-8 -*-
# @Project_name :  django_test
# @File         :  http_util.py
# @Author       :  Gu sir
# @Email        :  974547007@qq.com
# @Motto        :  Python is the best computer language in the world!
# Time          :  2023/4/8 16:07
from rest_framework.response import Response

from utils.constants import CONST


def resp_success(resp_data: dict):
    resp_data.update({CONST.SUCCESS: True})
    return Response(resp_data)


def response_failure(error_msg):
    return Response({CONST.SUCCESS: False, CONST.ERROR: error_msg})
